﻿package cn.nkjobsearch.publicClass;

public class Strings {
	/**
	 * 简单的去掉HTML代码中的标签
	 * */
	public static String strip_tags(String htmlStr) {
		StringBuilder sb = new StringBuilder();
		boolean flag = true;
		if (htmlStr == null) {
			return null;
		}
		char[] a = htmlStr.toCharArray();
		int length = a.length;
		for (int i = 0; i < length; i++) {
			if (a[i] == '<') {
				flag = false;
				continue;
			}
			if (a[i] == '>') {
				flag = true;
				continue; 
			}
			if (flag == true) {
				sb.append(a[i]);
			}
		}
		return sb.toString();
	}
}
